<?php 
    
    /**
     * 测试服务层
     */
    class userConnectService extends Service{

        /**
         * 类似于构造方法的init方法
         */
        public function init(){
        }

        public function getConnects(){
            $userConnectDao = $this->userConnectDao;
            //$userConnectDao->address = '小明';
            //$userConnectDao->namddddd= 'dsds';
            //$res  = $userConnectDao->where("`id`>1 and address='朝阳'")->select();
            //$res = $userConnectDao->where( array('id','between','1,2'), 'OR', array('address','=','朝阳') )->find();
            /*$res = $userConnectDao
            ->fields(array('id','address'))
            ->where( array('id','between','1,2'), 'OR', array('address','=','朝阳') )
            ->limit(5)
            ->order('id desc')
            ->select();*/
            //$res = $userConnectDao->group('address')->select(1,2,3);
            //$res = $userConnectDao->where( array('id','between','1,2'), array('address','=','朝阳') )->select();
            //$res = $userConnectDao->where( array('id','in','1,2,3') )->select();
            //$res = $userConnectDao->where( array('id','>', 0) )->select();
            //$res = $userConnectDao->where( array('id','=', 1) )->find();
            //$res = $userConnectDao->where(array('address','=','朝阳'))->find(2);
            //$res = $userConnectDao->select(1,2,3,4);
            //$res = $userConnectDao->find(2,3,4);
            //$res = $userConnectDao->where(array('id','>','0'))->getField('address');
            //$res = $userConnectDao->fields( array('id'=>'sss','address'=>'dd') )->where('id>0')->select();
            //$res = $userConnectDao->where(array('id','>','0'))->limit('1,2')->select();
            //$res = $userConnectDao->fields( array('id','user_id','address','count(address)'=>'sss') )->where('id>0')->select();
            
            //$userConnectDao->where = 'id>0';
            //$userConnectDao->where = array('id','in','1,2,3');
            //$userConnectDao->group = array('id','address');
            //$userConnectDao->limit = array(0,2);
            //$userConnectDao->pk = 2;
            //$userConnectDao->where = 'id=2 and address=\'北京\'';
            $userConnectDao->pk=2;
            $res = $userConnectDao->find();
            $stat = $userConnectDao->getLastQueryStat();
            P($stat);
            //$res = $userConnectDao->where( "id in (1,2,4)" )->select();
            P($res);
            //P($userConnectDao);
            //return $res;
        }
    }
?>